import request from '@/utils/request'

export function getRoleList(params) {
  return request({
    url: '/sys/role',
    params
  })
}

export function addRole(data) {
  return request({
    url: 'sys/role',
    method: 'post',
    data
  })
}

export function delRole(id) {
  return request({
    url: 'sys/role/' + id,
    method: 'delete'
  })
}
export function getRoleDetailById(id) {
  return request({
    url: '/sys/role/' + id

  })
}

export function updateRole(data) {
  return request({
    url: '/sys/role/' + data.id,
    method: 'put',
    data
  })
}

export function getCompanyById(id) {
  return request({
    url: '/company/' + id
  })
}

export function assignPerm(data) {
  return request({
    url: 'sys/role/assignPrem',
    method: 'put',
    data
  })
}
